// CameraCal.h

#pragma once

#include "Ravl/Vector2d.hh"
#include "Ravl/Matrix3d.hh"
#include "Ravl/SArray1d.hh"


namespace CameraCalN
{
	using namespace RavlN;

	class CalObservation2dC
	{
	public:
		CalObservation2dC()
		{
		}
		//: default constructor

		CalObservation2dC(RealT _u, RealT _v, bool _visible = true) :
		u(_u,_v),
			visible(_visible)
		{
		}
		//: initialise a valid observation at the given location


	public:
		Vector2dC u;
		//: co-ords of observation

		bool visible;
		//: true if this is a valid observation
	};

	class CalObservation2dArrayC : public SArray1dC<CalObservation2dC>
	{
	public:
		CalObservation2dArrayC()
		{
		}
		//: default constructor

		CalObservation2dArrayC(UIntT count) :
		SArray1dC<CalObservation2dC> (count)
		{
		}
		//: construct array of given length

		bool NormalScale(Matrix3dC& T) const; 
		//: get centroid and (mean distance to centroid * sqrt(2))

		void TransformHomogeneous(Matrix3dC& T);
		//: apply homogeneous transform to all valid observations
	};

}
